/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaSaida.java
 *
 * Created on 20/09/2010, 19:36:38
 */

package compilador.GUI;

import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Igor
 */
public class TelaSaida extends javax.swing.JFrame {

    /** Creates new form TelaSaida */
    @SuppressWarnings("static-access")
    public TelaSaida() {
        initComponents();
        setaComponentes();
        DefaultTableModel tablemodel = (DefaultTableModel) this.TabelaSimbolos.getModel(); //recupera model pra tabela de símbolos
        DefaultTableModel modelo = (DefaultTableModel) this.MatrizOcorrencia.getModel(); //recupera model pra matriz de ocorrência

        TabelaSimbolos.setSize(TabelaSimbolos.getParent().getWidth(),300); //ajusta tamanho da tabela de símbolos
        TabelaSimbolos.setRowHeight(50); //ajusta altura da linha

        tablemodel.setRowCount(0); //zera o número de linhas dos dois models acima recuperados
        modelo.setRowCount(0);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        PainelTitulo = new javax.swing.JPanel();
        TituloPanel = new javax.swing.JLabel();
        ConsoleAbas = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        MatrizOcorrencia = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        AreaErros = new javax.swing.JTextPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        TabelaSimbolos = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setAlwaysOnTop(true);

        jPanel1.setBackground(new java.awt.Color(218, 218, 240));
        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.setPreferredSize(new java.awt.Dimension(600, 397));

        PainelTitulo.setBackground(new java.awt.Color(218, 218, 240));

        TituloPanel.setFont(new java.awt.Font("Tahoma", 1, 18));
        TituloPanel.setText("Tabela de Símbolos");
        TituloPanel.setVerticalAlignment(javax.swing.SwingConstants.TOP);

        javax.swing.GroupLayout PainelTituloLayout = new javax.swing.GroupLayout(PainelTitulo);
        PainelTitulo.setLayout(PainelTituloLayout);
        PainelTituloLayout.setHorizontalGroup(
            PainelTituloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PainelTituloLayout.createSequentialGroup()
                .addComponent(TituloPanel)
                .addContainerGap(826, Short.MAX_VALUE))
        );
        PainelTituloLayout.setVerticalGroup(
            PainelTituloLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(TituloPanel)
        );

        MatrizOcorrencia.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Palavras", "Linhas"
            }
        ));
        jScrollPane1.setViewportView(MatrizOcorrencia);

        ConsoleAbas.addTab("Matriz de Ocorrencia", jScrollPane1);

        jScrollPane2.setViewportView(AreaErros);

        ConsoleAbas.addTab("Erros", jScrollPane2);

        TabelaSimbolos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "LEXEMA", "TIPO"
            }
        ));
        TabelaSimbolos.setRequestFocusEnabled(false);
        jScrollPane3.setViewportView(TabelaSimbolos);
        TabelaSimbolos.getColumnModel().getColumn(1).setResizable(false);
        TabelaSimbolos.getColumnModel().getColumn(1).setHeaderValue("TIPO");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(PainelTitulo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 998, Short.MAX_VALUE)
            .addComponent(ConsoleAbas, javax.swing.GroupLayout.DEFAULT_SIZE, 998, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(PainelTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ConsoleAbas, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1000, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TelaSaida().setVisible(true);

            }
        });
    }

    public JTabbedPane getConsoleAbas() {
        return ConsoleAbas;
    }

    public JTable getTabelaSimbolos() {
        return TabelaSimbolos;
    }

    public JTable getMatrizOcorrencia() {
        return MatrizOcorrencia;
    }

    public JTextPane getAreaErros() {
        return AreaErros;
    }

    public JScrollPane getjScrollPane1() {
        return jScrollPane1;
    }

    public JScrollPane getjScrollPane2() {
        return jScrollPane2;
    }

    public JScrollPane getjScrollPane3() {
        return jScrollPane3;
    }


    



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextPane AreaErros;
    private javax.swing.JTabbedPane ConsoleAbas;
    private javax.swing.JTable MatrizOcorrencia;
    private javax.swing.JPanel PainelTitulo;
    public javax.swing.JTable TabelaSimbolos;
    private javax.swing.JLabel TituloPanel;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    // End of variables declaration//GEN-END:variables



    private void setaComponentes() {
        ConsoleAbas = new JTabbedPane(); //ajusta aspectos referente a fatores e posicionamento da aba de texto
        ConsoleAbas.setSize(this.getWidth()/2,this.getHeight()/2);
        repaint();
    }

}
